### Variables
#
set $mod Mod4
set $left h
set $down j
set $up k
set $right l
set $term alacritty
set $menu wofi -S run
set $web firefox
set $lock swaylock -c 000000 --clock --indicator 

default_border pixel 2

gaps outer 18
gaps inner 18

### Output configuration
exec ~/.config/sway/waybar.sh
exec ~/.azotebg 

input * {
    xkb_layout us,ru
    xkb_options grp:caps_toggle
}

xwayland enable

 exec swayidle -w \
          timeout 600 'swaylock -f -c 000000 --clock --indicator' \
          timeout 1200 'systemctl suspend' \
          before-sleep 'swaylock -c 000000 --clock --indicator'

### Key bindings
#
# Basics:
#
    # Start a terminal
    bindsym $mod+Shift+Return exec $term

    # Lock screen
    bindsym $mod+Shift+w exec $lock

    # Start a web
    bindsym $mod+Shift+b exec $web

    # Kill focused window
    bindsym $mod+Shift+c kill

    # Start your launcher
    bindsym $mod+p exec $menu

    floating_modifier $mod normal

    # Reload the configuration file
    bindsym $mod+Shift+r reload

    # Exit sway (logs you out of your Wayland session)
    bindsym $mod+Shift+q exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'

bindsym --locked XF86AudioLowerVolume exec amixer set Master 5%- && pkill -x -RTMIN+11 waybar
bindsym --locked XF86AudioRaiseVolume exec amixer set Master 5%+ && pkill -x -RTMIN+11 waybar
bindsym --locked XF86AudioLowerVolume+shift exec amixer set Master 1%- && pkill -x -RTMIN+11 waybar
bindsym --locked XF86AudioRaiseVolume+shift exec amixer set Master 1%+ && pkill -x -RTMIN+11 waybar

#
# Moving around:
#
    # Move your focus around
    bindsym $mod+$left focus left
    bindsym $mod+$down focus down
    bindsym $mod+$up focus up
    bindsym $mod+$right focus right
    bindsym $mod+Left focus left
    bindsym $mod+Down focus down
    bindsym $mod+Up focus up
    bindsym $mod+Right focus right

    # Move the focused window with the same, but add Shift
    bindsym $mod+Shift+$left move left
    bindsym $mod+Shift+$down move down
    bindsym $mod+Shift+$up move up
    bindsym $mod+Shift+$right move right
    # Ditto, with arrow keys
    bindsym $mod+Shift+Left move left
    bindsym $mod+Shift+Down move down
    bindsym $mod+Shift+Up move up
    bindsym $mod+Shift+Right move right
#
# Workspaces:
#
    # Switch to workspace
    bindsym $mod+1 workspace number 1
    bindsym $mod+2 workspace number 2
    bindsym $mod+3 workspace number 3
    bindsym $mod+4 workspace number 4
    bindsym $mod+5 workspace number 5
    # Move focused container to workspace
    bindsym $mod+Shift+1 move container to workspace number 1
    bindsym $mod+Shift+2 move container to workspace number 2
    bindsym $mod+Shift+3 move container to workspace number 3
    bindsym $mod+Shift+4 move container to workspace number 4
    bindsym $mod+Shift+5 move container to workspace number 5
    # Note: workspaces can have any name you want, not just numbers.
    # We just use 1-10 as the default.
#
# Layout stuff:
#
    bindsym $mod+b splith
    bindsym $mod+v splitv

    # Switch the current container between different layout styles
    bindsym $mod+s layout stacking
    bindsym $mod+w layout tabbed
    bindsym $mod+e layout toggle split

    # Make the current focus fullscreen
    bindsym $mod+f fullscreen

    # Toggle the current focus between tiling and floating mode
    bindsym $mod+Shift+space floating toggle

    # Swap focus between the tiling area and the floating area
    bindsym $mod+space focus mode_toggle

    # Move focus to the parent container
    bindsym $mod+a focus parent
#
# Scratchpad:
#
    # Move the currently focused window to the scratchpad
    bindsym $mod+Shift+minus move scratchpad

    # If there are multiple scratchpad windows, this command cycles through them.
    bindsym $mod+minus scratchpad show
#
# Resizing containers:
#
mode "resize" {
    bindsym $left resize shrink width 10px
    bindsym $down resize grow height 10px
    bindsym $up resize shrink height 10px
    bindsym $right resize grow width 10px

    # Ditto, with arrow keys
    bindsym Left resize shrink width 10px
    bindsym Down resize grow height 10px
    bindsym Up resize shrink height 10px
    bindsym Right resize grow width 10px

    # Return to default mode
    bindsym Return mode "default"
    bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"


include /etc/sway/config.d/*
